const toString = Object.prototype.toString;

export function is(val: unknown, type: string): boolean {
    return toString.call(val) === `[object ${type}]`;
}

export function isNumber(val: unknown): val is number {
    return is(val, 'Number');
}

export function isString(val: unknown): val is string {
    return is(val, 'String');
}